package cn.jiadakeji.parent.controller;

import cn.jiadakeji.parent.common.core.controller.BaseController;
import cn.jiadakeji.parent.common.core.domain.AjaxResult;
import cn.jiadakeji.parent.dto.TermTeacherRelationDTO;
import cn.jiadakeji.parent.service.TermTeacherRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author heyanfeng
 * @create 2022-03-14 10:45
 */
@Api(value = "教师课程信息",tags = {"教师课程信息接口"})
@RestController
@RequestMapping("/term/teacher/relation")
public class TermTeacherRelationController extends BaseController {

    @Autowired
    private TermTeacherRelationService teacherRelationService;

    @ApiOperation("获取上课教师信息")
    @GetMapping("/teacherInfo")
    public AjaxResult getTermTeacherRelation(
            @ApiParam("课程表ID")
            @RequestParam("termCourseId") String termCourseId
    ){
        List<TermTeacherRelationDTO> teacherRelationDTO =  teacherRelationService.getTermTeacherRelation(termCourseId);
        return AjaxResult.success(teacherRelationDTO);
    }
}
